package cn.itamt.stars {
	import cn.itamt.stars.base.IStar;
	import cn.itamt.stars.base.Star;

	import flash.display.DisplayObjectContainer;
	import flash.geom.Rectangle;	

	/**
	 * 静态的行星(恒星?)
	 * @author tamt
	 */
	public class StaticStar extends Star implements IStar {
		protected var scaleX : Number;
		protected var scaleY : Number;

		public function StaticStar() {
		}

		override public function build(rendererClass : Class, rect : Rectangle, container : DisplayObjectContainer) : void {
			super.build(rendererClass, rect, container);
				
			x = _rect.left + _rect.width * Math.random();
			y = _rect.top + _rect.height * Math.random();
			scaleY = scaleX = .4 + Math.random() * .6;
		}

		override public function render() : void {
			super.render();
			
			_view.scaleX = scaleX;
			_view.scaleY = scaleY;
		}
	}
}
